﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterSite.Master" AutoEventWireup="true"
    CodeBehind="AddTimes.aspx.cs" Inherits="WebGui.Admin.AddTimes" %>

<%@ Register Assembly="DayPilot" Namespace="DayPilot.Web.Ui" TagPrefix="DayPilot" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <script src="../js/modal.js" type="text/javascript"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Content" runat="server">
    <script type="text/javascript">

        // required for copy'n'paste functionality
        var copied = null;

        /* Event editing helpers - modal dialog */
        function dialog() {
            var modal = new DayPilot.Modal();
            modal.top = 60;
            modal.width = 300;
            modal.opacity = 70;
            modal.border = "10px solid #d0d0d0";
            modal.closed = function () {
                if (this.result == "OK") {
                    dpc.commandCallBack('refresh');
                }
                dpc.clearSelection();
            };

            modal.height = 250;
            modal.zIndex = 100;
            return modal;
        }

        function create(start, end, comment) {
            var modal = dialog();
            modal.showUrl("New.aspx?start=" + start.toStringSortable() + "&end=" + end.toStringSortable() + "&r=" + comment);
        }

        function edit(e) {
            var modal = dialog();
            modal.showUrl("Edit.aspx?id=" + e.value());
        }

        function open(e) {
            var modal = dialog();
            modal.showUrl("Open.aspx?id=" + e.value());
        }

        
     
    </script>



    <DayPilot:DayPilotNavigator ID="CalNavigator" runat="server" BoundDayPilotClientObjectName="dpc"
        SelectMode="Week" CssClassPrefix="navigator_" DataStartField="starttime"
        DataEndField="endtime" VisibleRangeChangedHandling="CallBack" OnVisibleRangeChanged="CalNavigator_VisibleRangeChanged"
        ShowWeekNumbers="True" WeekStarts="Monday"></DayPilot:DayPilotNavigator>
    <DayPilot:DayPilotCalendar 
    ID="CalLessons" runat="server" DataStartField="starttime"
    DataEndField="endtime" 
    DataTextField="comments" 
    DataValueField="id" 
    OnEventMove="CalLessons_EventMove"
    Days="7"
    OnTimeRangeSelectedJavaScript="create(e.start, e.end, e.comment);" 
    TimeRangeSelectedHandling="CallBack"
    EventMoveHandling="CallBack" 
    EventMoveJavaScript=""
    ContextMenuID="DayPilotMenu" 
    OnEventMenuClick="CalLessons_EventMenuClick" 
    EventResizeHandling="CallBack"
    OnEventResize="CalLessons_EventResize" 
    EventClickHandling="JavaScript" 
    EventClickJavaScript="edit(e);"
    EventSelectHandling="JavaScript" 
    ClientObjectName="dpc" 
    EventEditHandling="CallBack"
    OnEventEdit="CalLessons_EventEdit"
    EventDeleteHandling="JavaScript"
    OnEventDelete="CalLessons_EventDelete" 
    EventDeleteJavaScript="if (confirm('Do you really want to delete ' + e.text() + ' ?')) dpc.eventDeleteCallBack(e);"
    OnEventSelect="CalLessons_EventSelect" 
    OnRefresh="CalLessons_Refresh" 
    EventSelectColor="Blue"
    xShowalldayevents="True" 
    UseEventBoxes="Always" 
    AfterRenderJavaScript="afterRender(data);" 
    ShowToolTip="true" 
    EventDoubleClickHandling="Edit"
    EventDoubleClickJavaScript="ask(e);" 
    EventHoverHandling="Bubble" 
    TimeFormat="Auto"
        ContextMenuSelectionID="MenuSelection" OnCommand="CalLessons_Command"
        CssClassPrefix="calendar_" HourNameBackColor="" BorderColor="#A0A0A0" CellBorderColor="#A0A0A0"
        EventBorderColor="#505050" AllDayEventBorderColor="#a0a0a0" RecurrentEventImage="../Media/recur10x9.png"
        RecurrentEventExceptionImage="../Media/recurex10x9.png" Direction="Auto" EventArrangement="Full"
        Style="top: 1px; left: 0px; width: 41%; height: 431px" CellDuration="5" 
        CellHeight="15" HourWidth="40" BackColor="#D9D9D9" 
        onbeforecellrender="CalBookings_BeforeCellRender" 
        onbeforeeventrender="CalBookings_BeforeEventRender">
    </DayPilot:DayPilotCalendar>
    <br />
    <DayPilot:DayPilotMenu ID="DayPilotMenu" runat="server">
        <DayPilot:MenuItem Text="åben" Action="JavaScript" JavaScript="open(e);">
        </DayPilot:MenuItem>
        <DayPilot:MenuItem Text="Rediger" Action="JavaScript" JavaScript="edit(e)"></DayPilot:MenuItem>
        <DayPilot:MenuItem Text="-------" Action="NavigateUrl"></DayPilot:MenuItem>
        <DayPilot:MenuItem Text="Slet" Action="Callback" Command="Delete"></DayPilot:MenuItem>
    </DayPilot:DayPilotMenu>
    <DayPilot:DayPilotMenu ID="MenuSelection" runat="server">
        <DayPilot:MenuItem Action="JavaScript" JavaScript="create(e.start, e.end, e.comment);"
            Text="Lav en ny lektion" />
        <DayPilot:MenuItem Text="-"></DayPilot:MenuItem>
        <DayPilot:MenuItem Action="JavaScript" JavaScript="alert('Start: ' + e.start.toString() + '\nEnd: ' + e.end.toString());"
            Text="vis valgte tidsrum" />
    </DayPilot:DayPilotMenu>
    <DayPilot:DayPilotBubble ID="DayPilotBubble" runat="server" OnRenderContent="DayPilotBubble_RenderContent"
        ClientObjectName="bubble" ShowLoadingLabel="true" HideAfter="500">
    </DayPilot:DayPilotBubble>
    <br />
    <br />
</asp:Content>
<asp:Content runat="server" ID="Content3" ContentPlaceHolderID="HeadLine">
    <h1>
        Tilf&oslash;j tider</h1>
</asp:Content>
